package com.kuwei.servlet;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Service;

import com.kuwei.base.ParamerException;
import com.kuwei.base.ServiceException;
import com.kuwei.servlet.frame.BaseServlet;
import com.kuwei.utils.CommonUtils;
import com.kuwei.utils.Constants;
import com.kuwei.utils.ReturnResult;
import com.kuwei.utils.ServiceConstants;
import com.kuwei.utils.Utility;

@Service("productServlet")
public class ProductServlet extends BaseServlet{

	
	public void getProduct(HttpServletRequest request,HttpServletResponse response,Map<String, Object> rtnMap) throws ServiceException, ParamerException{
		ReturnResult result = new ReturnResult();
		Map<String,Object> reqMap = new HashMap<String, Object>();
		
		try {
			reqMap.put("STAUTS_CD", Constants.STATE_1000);
			List<Map<String, Object>> list = sqlSessionDaoSupport.getSqlSession().selectList(ServiceConstants.QUERY_PRODUCT,reqMap);
			result.setContent(Constants.SUCCESS, null,list);
		} catch (Exception e){
			result.setContent(Constants.FAIL, e.getMessage());
		}
		
		rtnMap.put("data", result.getContent());
	}
}
